<?php

namespace Part13_BuilderPattern\Code1;

// 指挥者
class PersonDirector
{
    private $builderObj;

    public function __construct($builderObj)
    {
        $this->builderObj = $builderObj;
    }

    // 建造方法，固定了建造的顺序
    public function createPerson()
    {
        $this->builderObj->buildHead();
        $this->builderObj->buildBody();
        $this->builderObj->buildArmLeft();
        $this->builderObj->buildArmRight();
        $this->builderObj->buildLegLeft();
        $this->builderObj->buildLegRight();
    }
}